Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
canvas-sketch error: "THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"

I am using canvas-sketch to create some Three.js content.

I used following command for Three.js template

canvas-sketch --new --template=three --open

The installed version is 1.11.14

canvas-sketch -v

When I try to access THREE.ParametricGeometry, it gives the error "THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"

// Ensure ThreeJS is in global scope for the 'examples/'
global.THREE = require("three");
// Include any additional ThreeJS examples below
require("three/examples/js/controls/OrbitControls");

const canvasSketch = require("canvas-sketch");

// code 
const geometry = new THREE.ParametricGeometry(calculateHelicoid, 25, 25)
// rest of the code

In order to fix it, I add the following require

require("three/examples/jsm/geometries/ParametricGeometry.js")

But then it gives the error: ParseError: 'import' and 'export' may appear only with 'sourceType: module' line 6 threejs_marbles/node_modules/three/examples/jsm/geometries/ParametricGeometry.js

Any way to fix it?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I was setting the wrong path, my require had examples/jsm/..., it should've been examples/js/...

require("three/examples/js/geometries/ParametricGeometry.js")
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda